new function ()
{
        /**
         * @private
         * A reference to the Function protoype
         * @type Object
         */
        
    var F= Function.prototype
        /**
         * @private
         * A reference to the Array slice method
         * @type Function
         */
    ,   S= Array.prototype.slice
    
        /**
         * @private
         * The anonymous keyword
         * @type String
         */
    ,   A= 'anonymous';
    
    
    /**
     * Implement any number of properties on a constructors prototype.
     * 
     * @param {...Object}        Any number of objects or named functions
     * @return {Function}        A reference to the constructor
     * @see #implementStatic
     * @see #implement.preventOverride
     */
    F.implement= function () 
    {
        this.implementStatic.apply(this.prototype, arguments);
        return this;  
    };

    /**
     * Implement any number of properties on a constructor directly.
     * @param {...Object}        Any number of objects or named functions
     * @return {Function}
     */
    F.implementStatic= function () 
    {
        var trait= null
        ,   n= arguments.length
        ,   i= 0
        ,   canOverwrite= !F.implement.preventOverride
        ,   accessor
        
        for (; i < n; i++) 
        {
            trait= arguments[i];
            if (null == trait)
                continue;

            if ('function' === typeof trait) 
            {
                accessor= trait.getName(); 
                if (A !== accessor && (canOverwrite || !(accessor in this)))
                    this[accessor]= trait;
            }
            else for (accessor in trait) 
            {
                if (canOverwrite || !(accessor in this))
                    this[accessor]= trait[accessor];
            }
        }
        
        F.implement.preventOverride= true;
        return this;
    };

    /**
     * A flag variable that you can use to prevent or allow the overriding
     * of properties defined on a constructors prototype. Note that after
     * each invocation of #implement or #implementStatic, that this value
     * is reset to true.
     * 
     * @example
     *     <code>
     *         <pre>
     *         
     *         
     *         
     *         </pre>
     *     </code>
     * 
     * @type {Boolean}
     */
    F.implement.preventOverride= true;

    
    /**
     * Determine a functions name.
     * @return {String}
     */
    F.getName= new function () 
    {
        // use the non-standard Function.prototype.name property if supported
        if ('name' in F) return function () 
        {
            var name= this.name;
            if ('' === name || 'Empty' === name)
                return A;
                
            return name;
        }
        else return function () // parse the function name 
        {
            if (this.name)
                return this.name;
                
            var result = String(this).match(/^function\s([\w|$]+)/);
    	    return this.name= String(result ? result[1] : A);
        }
    };
    
    
    Function.implement
    (
        {
            /**
             * Extend one constructors prototype by anothers.
             * @param {Function} Super   The constructor to inherit from.
             * @return {Function}        A reference to the extended constructor.
             */
            inherits: function (Super) 
            {
                if (this === Super || 'function' !== typeof Super)
                    throw new TypeError('Cannot inherit from invalid constructor.');
                    
                function Intermediary () {;};
                Intermediary.prototype= Super.prototype;
                Intermediary.prototype.constructor= this;
                
                this.prototype= new Intermediary;
                this.prototype.parent= Super.prototype;
                return this;
            }
            
            /**
             * Preset a function with an execution scope and any number of
             * arguments. Any additional arguments supplied to the bound
             * function will be concatenated to the preset arguments provided 
             * to this method.
             * 
             * @example
             *     <code>
             *         <pre>
             *         
             *             var object=
             *             {
             *                 value: 'localValue'
             *             ,   getValue: function () 
             *                 {
             *                     return this.value;
             *                 }
             *                 
             *             ,   setValue: function (value)
             *                 {
             *                     this.value= value;
             *                 }
             *             };
             *             
             *             window.value= 'globalValue';
             *         
             *             alert(object.getValue()); // alerts 'localValue';
             *         
             *             var getValue= object.getValue;
             *             
             *             alert(getValue()); // alerts 'globalValue';
             *             
             *             getValue= getValue.bind(object);
             *             
             *             alert(getValue()); // alerts 'localValue';
             *         
             *         </pre>
             *     </code>
             * 
             * @param {Object} executionScope
             * @param {...Object} presetArgs
             * @return {Function}
             */           
       ,    bind: function (executionScope) 
            {
                var method= this
                ,   presetArgs
        
                if (arguments.length < 2) return function () 
                {
                     return method.apply(executionScope, arguments);
                }

                presetArgs= S.call(arguments, 1);
                return function () 
                {
                    return method.apply(executionScope, presetArgs.concat(arguments));
                };
            } 
            
            /**
             * Determine if an object is of a particular type or not. 
             * 
             * @example
             *     <code>
             *         <pre>
             *         
             *             var primitiveString= 'hello'
             *             ,   objectString= new String('hello')
             *             
             *             // ECMAScripts type identification system is borken
             *             alert (primitiveString instanceof String); // false
             *             alert ('string' === typeof objectString); // false
             *             alert (null instanceof Object); // false
             *             alert ('object' === typeof null); // true
             *             
             *             // this method normalizes it
             *             alert (String.type(primitiveString)); // true
             *             alert (String.type(objectString)); true
             *             alert (Object.type(null)); // false
             *             
             *             // you can also use it with your own objects
             *             
             *             function A () 
             *             {
             *                 // implement
             *             };
             *             
             *             B.inherits(A);
             *             function B () 
             *             {
             *                 // implement
             *             };
             *             
             *             var a= new A
             *             ,   n= new B
             *             
             *             alert(A.type(a)); // true
             *             alert(B.type(a)); // false
             *             alert(A.type(b)); // true- B is a subclass of A
             *             alert(B.type(b)); // true
             *         
             *         </pre>
             *     </code>
             *     
             * @param {Object} value    Any value.
             * @return {Boolean}        
             * @see #is
             */
        ,   type: function (value) 
            {
                return null == value ? false : Object(value) instanceof this;   
            }
            
            /**
             * Determine if an object was constructed by a specific constructor.
             * @param {Object} value            Any value.
             * @return {Boolean}
             * @see #type
             */
        ,   is: function (value) 
            {
                return null == value ? false : value.constructor === this;
            }
            
            /**
             * Defer the execution of a function to later point in time, optionally
             * supplying an execution scope and any number of arguments to use
             * during execution.
             * 
             * @param {Number} interval            The milisecond interval to 
             * @param {Object} executionScope      Optional. The object scope
             * @param {...Object} presetArgs       Optional. Any nuber of arguments.
             * @return {Object}
             * @see #bind
             */
        ,   defer: function (interval, executionScope) 
            {
                var method= this.bind.apply(this, [executionScope].concat(S.call(arguments, 2)))
                ,   deferred= 
                    {
                        hasExecuted: false
                    ,   createdOn: new Date().getTime()
                    ,   interval: interval
                    ,   result: null
                    ,   fault: null
                    ,   dispose: function () 
                        {
                            clearTimeout(this.timeoutId);
                            delete this.timeoutId;
                            this.execute= function () {;};
                            method= null;
                        }
                    ,   execute: function () 
                        {
                            var status= false;
                            deferred.hasExecuted= true;
                            try 
                            {
                                deferred.result= method();
                                status= true;
                            }
                            catch (thrown) 
                            {
                                deferred.fault= thrown;
                            }
                            deferred.dispose();
                            if ('function' === typeof deferred.onExecute)
                                deferred.onExecute(status);
                        }
                    };
                
                deferred.timeoutId= setTimeout(deferred.execute, interval);
                return deferred;
            }
        }
    );
}
